Skip to content

Conversation

TonyKim9401
Copy link
Contributor

@TonyKim9401 TonyKim9401 commented Oct 28, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@TonyKim9401 TonyKim9401 changed the title Same Tree [Tony] WEEK 12 Solutions Oct 28, 2024
@TonyKim9401 TonyKim9401 requested a review from HC-kang October 28, 2024 01:31
Comment on lines +8 to +9
if (p == null && q == null) return true;
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😉

Suggested change
if (p == null && q == null) return true;
return false;
return p == null && q == null;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@bky373 bky373 Nov 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L7 ~ L10 을 조금 더 줄여서 아래처럼 가능할 것 같습니다!

if (p == null || q == null) {
    return p == q;
}

@TonyKim9401 TonyKim9401 marked this pull request as ready for review November 2, 2024 02:17
@TonyKim9401 TonyKim9401 requested a review from a team as a code owner November 2, 2024 02:17
Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전반적으로 코드가 읽기 편해서 알고리즘을 이해하기 편했습니다! 고생많으셨습니다!

Copy link
Contributor

@bky373 bky373 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 깔끔하게 풀어주셔서 코멘트 드릴 부분이 크게 없었네요!
한 주 동안 고생 많으셨습니다!

Comment on lines +20 to +21
if (currentEnd >= nextStart) {
currentInterval[1] = Math.max(currentEnd, nextEnd);
Copy link
Contributor

@bky373 bky373 Nov 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(사소) 이 조건이면 max 로 하지 않고, currentInterval[1] = currentEnd 로 해도 괜찮아 보입니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아앗 nextStartnextEnd 를 잘못 봤군요 위 내용은 넘어가시면 될 것 같습니다!

@@ -0,0 +1,17 @@
// TC: O(n)
// retreive all given nodes
// SC: O(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dfs 스택을 사용하는 만큼 O(N) 이지 않을까요~?

@TonyKim9401 TonyKim9401 merged commit 849ece4 into DaleStudy:main Nov 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

4 participants